A technique, called stereo measurement, in which the three-dimensional position of an object is measured from the correspondence relation between a plurality of images captured by a plurality of cameras with different viewpoints has been heretofore known.
For example, the three-dimensional position is measured as the following manner. A pair of images is selected from a plurality of images, and the three-dimensional position is measured from the positional relation between the positions of measurement points on selected images and the positions of cameras captured the selected images. However, measurement accuracy differs depending on the position of the camera, the focal length of the lens, the size of the imaging element, resolution, and the position of the measurement point on the image. For this reason, in order to increase the measurement accuracy of the three-dimensional position, it is necessary to select an optimum pair of images in the relation with the measurement points.
However, according to the conventional technique, since optimum images are selected in the relation with a specific image from among a plurality of images, it is not possible to select an image pair not including the specific image. For this reason, it is not possible to select an optimum image pair in the relation with the measurement point, causing deterioration in the measurement accuracy of the three-dimensional position.